#ifndef LOGDBMANAGER_H
#define LOGDBMANAGER_H

#include <QSqlError>
class QString;

class LogDbManager
{
public:
    enum EventType {
        ET_AllType,

        ET_SysInfo,
        ET_SysWarn,
        ET_SysError,

        ET_InserStudy,
        ET_RemoveStudy,
        ET_UpdateStudy,
        ET_ImportStudy,
        ET_ExportStudy,
        ET_SendStduy,

        ET_Exposure,
        ET_InsertImage,
        ET_PrintImage,
        ET_SendImage,
        ET_RemoveImage,
        ET_ImportImage,
        ET_ExportImage,
        ET_UpdateImage,

        ET_CreateReport,
        ET_PrintReport,
        ET_RemoveReport,
        ET_ImportReport,
        ET_ExportReport,
        ET_UpdateReport,

        ET_TypeCount,
    };

    LogDbManager() {}

    static bool createLogDb(bool recreate = false);
    static bool insertMessageToDb(EventType type, const QString &msg);
    static bool removeLogRecord();

    static QSqlError lastError;
};

#endif // LOGDBMANAGER_H
